﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PTop.Front.Data.Context;
using PTop.Front.Data.Entity;

namespace PTop.Front.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult Portfolio()
        {
            return View();
        }

        public ActionResult Contact()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Contact(ContactEntity entity)
        {
            var context = new MyDbContext();
            entity.CreateTime = DateTime.Now;
            context.Contacts.Add(entity);
            context.SaveChanges();
            ViewBag.MessageTip = "您已经成功提交，请等待客服与您联系！";
            return View();
        }

        public ActionResult Codes()
        {
            return View();
        }

        public ActionResult Icons()
        {
            return View();
        }
    }
}
